Skip to content
This repository was archived by the owner on Oct 31, 2024. It is now read-only.

Merge with upstream py4web#9

Open
KellerKev wants to merge 886 commits into
KellerKev:masterfrom
web2py:master
Open

Merge with upstream py4web#9
KellerKev wants to merge 886 commits into
KellerKev:masterfrom
web2py:master

Conversation

@KellerKev
Copy link
Copy Markdown
Owner

No description provided.

mdipierro and others added 30 commits May 9, 2026 19:52
- Tighten the static/dynamic page intros and explain the routing model
  (action-prefix per app, _default exception) up front.
- Replace ambiguous wildcard documentation with explicit syntax forms
  and concrete filter descriptions.
- Update the scaffold tree to match the actual on-disk structure
  (no.css, not bulma) and clarify each entry.
- Tighten the @app_watch_handler, domain-mapped app and custom error
  page sections.
The class has shipped as IconStyleFontawsome (missing the 'e') since
the start, while the documentation and downstream code consistently
use the correct spelling 'IconStyleFontawesome'. Add an alias so the
documented name imports successfully; keep the original symbol for
backwards compatibility.
- Document the full Auth() constructor and the auth.param.* knobs.
- List the actual auth_user fields, including the conditional
  last_password_change/phone_number/past_passwords_hash fields.
- Update the exposed API list (added all_models/config/unsubscribe).
- Fix JwtTokenPlugin example that imported SimpleTokenPlugin.
- Correct 'Authentication' -> 'Authorization' header references in
  the token plugin section and clarify the on_accept callback
  signature.
- Update the Form() constructor signature to include the missing
  showreadonly, submit_value, show_id, auto_process, T and **kwargs
  arguments and add FormStyleTailwind to the formstyle list.
- Replace the form.process().accepted leftover from web2py with the
  current auto-processing form.accepted pattern.
- Correct the Validation functions section: validators mutate
  form.errors instead of returning a dictionary; fix the syntax error
  in the example.
- Update the Grid() constructor signature to match grid.py: add
  field_id and required_fields, document show_id default of None
  (auto-detect), and explain that create/details/editable/deletable
  accept True/False/URL/callable.
- Document FormStyleTailwind, GridClassStyleBulma/Bootstrap5/Tailwind
  and the icon styles (Fontawesome/BootstrapIcons/IconStyle).
- Replace the search/CRUD/icon-style sections, which had truncated
  bullets, with prose that matches what the code does.
- Replace the 'Using callable parameters' section that referenced a
  non-existent GridActionButton class and undocumented kwargs with
  the actual dict/helper-based custom-button API.
- Reflow the Reference Fields example so the left-join code block is
  syntactically valid.
Real-world apps (fadebook, feeds, birdwatching) all wire up the same
two helpers in common.py but neither was documented:

- py4web.utils.downloader.downloader is the standard way to serve
  files referenced by Field('upload'). Document the three steps
  (UPLOAD_FOLDER, the @action('download/<filename>') view, and the
  field's download_url) in the Forms chapter.
- py4web.utils.mailer.Mailer is what auth.sender expects. Add a
  Sending email section to the Auth chapter describing the
  constructor arguments and noting that if no sender is configured,
  the body is logged to the console.
`make docs-pdf` builds a single-volume English PDF of the manual
into docs/_build/py4web.pdf using the existing rinohtype docs
extra (no new dependencies needed).

Two related changes in docs/conf.py:

- Switch highlight_language from 'none' to 'python3' so unlabelled
  literal blocks (`::` and `.. code::`) get Python syntax
  highlighting; explicit `.. code:: bash|html|json|...` blocks keep
  their own lexers. The python3 lexer falls back to plain text if a
  snippet doesn't parse, so it's safe as a default.
- Set pygments_style to 'friendly' and forward it to the rinoh
  document config so HTML and PDF use the same colour scheme.
Add the contributors that show up in 'git log' to the existing
acknowledgements list in README.rst (which is included verbatim into
chapter 1). Each entry uses the contributor's name where they signed
commits with one, and their GitHub handle otherwise; no email
addresses are included.

Tidy-ups picked up while rebuilding the docs:

- conf.py: relax highlight_language from 'python3' to 'default' so
  Sphinx silently falls back to plain text on snippets that aren't
  valid Python (the python3 lexer was warning on URLs/HTML in
  unlabeled literal blocks).
- Resolve duplicate auto-section-label warnings by renaming
  chapter-16's 'Prerequisites' subsection (now 'Altcha
  prerequisites') and removing a redundant explicit label in
  chapter-14.
Bumps [urllib3](https://github.com/urllib3/urllib3) from 2.6.3 to 2.7.0.
- [Release notes](https://github.com/urllib3/urllib3/releases)
- [Changelog](https://github.com/urllib3/urllib3/blob/main/CHANGES.rst)
- [Commits](urllib3/urllib3@2.6.3...2.7.0)

---
updated-dependencies:
- dependency-name: urllib3
  dependency-version: 2.7.0
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Your Name <you@example.com>
Co-authored-by: Your Name <you@example.com>
1. apps/_scaffold/AGENTS.md (new file) — Documents the 11 most common py4web paper-cuts in one place. Bundled into py4web new_app so every new app starts with it loaded. Scaffold zip rebuilt to include it.

2. pluralize/pluralize/__init__.py (already committed by you as 2fb799e) — Translator now accepts plain-string values both at load() time (auto-normalize to {"0": value} with warning) and at lookup time. Three new regression tests in tests/test_simple.py.

3. pydal/pydal/objects.py (Field.__init__) — Detects default=dict / default=list / default=set / default=tuple, warns, and rewrites to default=lambda: cls(). No more "TypeError: <class 'dict'> is not JSON serializable" on insert.

4. pydal/pydal/base.py (DAL.__init__) — For SQLite, when the DB file is missing but .table markers for this DB's URI hash exist on disk, raise a clear RuntimeError naming both the fix paths: rm <folder>/<hash>*.table or fake_migrate_all=True. Scoped by URI hash so stray markers from other DBs in the same folder don't false-positive (verified with the existing pydal test suite — 170 tests still pass, including ones that pile multiple DBs into the same dir).

5. py4web/py4web/core.py — Two changes:
   - Reloader.register_route: detects same (rule, method) bound to two different functions and raises a clear RuntimeError before ombott raises its noisy RouteMethodError, with a hint about the @action('/') + @action('index') aliasing.
   - run CLI: new --dev flag — sets --mode=development, --debug, --logging_level=DEBUG, prints a yellow "do not use in production" warning. Honors explicit flags (only flips defaults).
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.